package Model;

import java.io.Serializable;

import Messaging.Notification;
import Messaging.NotificationManager;

/*
 * @author Paolo Cordova
 */

public class CornerSpace extends Space implements Serializable {
	final static long serialVersionUID = 208;
	
	public CornerSpace() 
	{
		Name_ = "NONE";
	}
	
	public CornerSpace(String name) 
	{
		Name_ = name;
	}
	
	public void landOn(Player p) 
	{
		if (this.Name_.equals("Go To Jail!")) 
		{
			NotificationManager.getInstance().notifyObservers(Notification.ACTION_MESSAGE, p.getName() + " is in jail!");
			p.goToJail();
		}
		
		else if (this.Name_.equals("Go")) 
		{
			p.updateCash(400);
			NotificationManager.getInstance().notifyObservers(Notification.ACTION_MESSAGE, p.getName() + " has been awarded $400 for landing on GO!");
		}
	}
}
